These view modifiers customize the appearance, sizing, and interaction behavior of views presented using sheet
in the Scripting app. They allow for adaptive presentations, resizing with detents, background interaction control, and more.
Apply these modifiers to the root view of the sheet content (e.g.,
<VStack>
,<NavigationStack>
, or<List>
).
presentationCompactAdaptation
Defines how a sheet adapts in compact horizontal or vertical size classes.
PresentationAdaptation
options:"automatic"
– System default behavior"fullScreenCover"
– Adapts to full-screen presentation"sheet"
– Adapts to sheet-style presentation"popover"
– Adapts to popover-style (where supported)"none"
– Disables adaptationpresentationDragIndicator
Controls visibility of the drag indicator at the top of the sheet.
presentationDetents
Defines the available heights ("detents") that the sheet can rest at. If multiple detents are provided, the user can drag the sheet to resize it.
PresentationDetent
values:"medium"
– Approximately half screen height (not available in compact vertical size class)"large"
– Full screen heightnumber > 1
– A fixed height in pointsnumber between 0 and 1
– A fractional height (e.g., 0.5
means 50% of available height)presentationBackgroundInteraction
Defines whether and how the user can interact with views behind the presented sheet.
Allow background interaction up to a certain sheet size:
presentationContentInteraction
Controls how the sheet prioritizes resizing vs scrolling when the user swipes up.
"resizes"
: Swipe gesture first resizes the sheet, then scrolls content."scrolls"
: Content inside (e.g., ScrollView
) scrolls immediately."automatic"
: System default (usually prefers resizing first).presentationCornerRadius
Sets a custom corner radius for the sheet background.
Modifier | Description |
---|---|
presentationCompactAdaptation |
Defines how the sheet adapts in compact size classes |
presentationDragIndicator |
Shows or hides the drag indicator |
presentationDetents |
Defines the heights the sheet can rest at |
presentationBackgroundInteraction |
Controls interaction with the background view during sheet presentation |
presentationContentInteraction |
Determines whether sheet resizes or content scrolls on swipe |
presentationCornerRadius |
Sets a custom corner radius for the sheet |